<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

        .outer-box {
            width: 200px;
            height: 200px;
            outline: 1px solid red;
            padding: 50px;
        }

        .inner-box {
            width: 100px;
            height: 100px;
            outline: 1px solid blue;
        }

    </style>
</head>
<body>
    <div class="outer-box">
        <div class="inner-box"></div>
    </div>

    <script>

        const outerBox = document.querySelector('.outer-box');
        const innerBox = document.querySelector('.inner-box');

        outerBox.addEventListener('mouseenter', () => {
            console.log('外盒子');
        });

        innerBox.addEventListener('mouseenter', () => {
            console.log('内盒子');
        });

    </script>
</body>
</html>
